<?php

namespace App\Http\Controllers;
use App\SubModel;
use Illuminate\Http\Request;

class SubController extends Controller
{
    public function sub(){
        return view('sub');

    }
    public function sub_add(Request $request){
        $input=$request->input();
        unset($input['_token']);
        $ok=SubModel::create($input);
        return $ok?'قوشۇش مۇۋاپىقيەتلىك بولدى!':'قوشۇش مەغلۇپ بولدى!';
    }

    public function sub_table(){
        $uqur=SubModel::get();
        return view('sub_table',compact("uqur"));

    }
}
